package cn.echoedu.model;

import java.sql.SQLException;
import java.util.List;

import cn.echoedu.daoconstants.TableName;
import cn.echoedu.entity.HomePageImage;
import cn.echoedu.entity.receivecommand.IndexPicQueryReceive;

public class HomePageImageModel extends BaseModel{
	private final String T="HomePageImageControl";

	public HomePageImageModel(){

	}
	public List<HomePageImage> queryByLeftJoinAndCommand(String command,String sortsql) throws SQLException {
		// TODO Auto-generated method stub

		List<HomePageImage> list=getDAORead().getPojoForLeftJoinAndColumn(getConnection(),
				TableName.HOMEPAGE_IMAGE_TABLE,TableName.IMAGE_TABLE,"imageid","imageid"
				,"schoolcode",command,sortsql);
		return list;
	}
//	select * from homepageimage left join image on (homepageimage.imageid = image.imageid)
//	where schoolcode = 104 order by publishtime desc;
	public List<HomePageImage> queryHomePageImage(IndexPicQueryReceive indexpicquery) {
		// TODO Auto-generated method stub
		try {
		return getDAORead().getPojoForLeftJoinAndColumn(getConnection(), TableName.HOMEPAGE_IMAGE_TABLE,
					TableName.IMAGE_TABLE, "imageid", "imageid", "schoolcode", "104",
					"order by publishtime desc");
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}

}
